<h1><?php echo $title;?></h1><br>
<p><?php echo anchor("cnews/create", '<button class="btn" type="button">Add News</button>');?></p><br>
<?php
if ($this->session->flashdata('message')){
	echo "<div class='message'>".$this->session->flashdata('message')."</div>";
}

if (count($news)){
	echo '<table cellpadding="0" cellspacing="0" border="0" class="bordered-table zebra-striped" id="example">';
	echo "<thead>\n<tr valign='top'>\n";
	echo "<th>No</th>\n<th>Title</th><th>Full Path</th><th>Short description</th><th>Activate</th><th>Actions</th>\n";
	echo "</tr>\n</thead>\n<tbody>\n";
	$i = 1;
	foreach ($news as $key => $list){
		echo "<tr valign='top'>\n";
		echo "<td align='center'>".$i++."</td>\n";
		echo "<td align='center'>".$list['title']."</td>\n";
		echo "<td>";
   		if (!preg_match("/\.html$/",$list['path'])){
  			$list['path'] .= ".html";
  		}		
		echo "/". $list['path'];
		echo "</td>";
		echo "<td align='center'>".$list['shortdesc']."</td>\n";
		
		if($list['activate']==1) 
			$activate = 'active';
		else 
			$activate = 'inactive';
			
		echo "<td align='center'>". $activate."</td>\n";
		echo "<td align='center'>";
		echo anchor('cnews/edit/'.$list['news_id'],'edit');
		echo " | ";
		echo anchor('cnews/delete/'.$list['news_id'],'delete',array('class'=>'delete-item'));
		echo "</td>\n";
		echo "</tr>\n";
	}
	echo "</tbody>\n</table>";
}
?>